﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyWeb.API.Common
{
    /// <summary>
    /// API接口请求的通用类
    /// </summary>
    public abstract class BaseRequestModel<T> : IRequest where T : IResponse
    {
        /// <summary>
        /// http 请求模式,默认get
        /// </summary>
        [JsonIgnore]
        public virtual Boolean HttpGet
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// 默认请求的 controler地址
        /// </summary>
        [JsonIgnore]
        public abstract String ApiName
        {
            get;
        }

        /// <summary>
        /// 基本参数验证
        /// </summary>
        public virtual void Validate()
        {

        }


        public string ServiceUrl
        {
            get;
            set;
        }
    }
}
